
#include "S_9_Maintenance_doSet.h"
#include "string.h"
#include "mi_iid_define.h"
#include "spec.h"
#include "main.h"

static void P_9_1_Clean_doSet(property_operation_t *o)
{
	char *c = NULL;
    // 判断数据格式是否正确，如果错误，返回代码: OPERATION_ERROR_VALUE
    if (o->value.format != PROPERTY_FORMAT_STRING)
    {
        o->code = OPERATION_ERROR_VALUE;
        return;
    }

    // TODO: 执行写操作: o->value.data.string.value;

	LOG_INFO("%s, %s\r\n",__func__,o->value.data.string.value);
	
    // 如果成功，返回代码: OPERATION_OK
    o->code = OPERATION_OK;
		
	c = strtok(o->value.data.string.value,",");

  CloudSetting(SELFCLEAN_SET,atoi(c),0);  
		
		
    //上报状态，通知app状态变化，统一APP修改、定时器触发后的上报机制
//    P_9_1_Clean_doChange_notify(o->value.data.string.value);

    return;
}

void S_9_Maintenance_doSet(property_operation_t *o)
{
    switch (o->piid)
    {
        case PIID_9_1_Clean:
            P_9_1_Clean_doSet(o);
            break;

        default:
            o->code = OPERATION_ERROR_VALUE;
            break;
    }
}
